<template>
  <h1>异步组件</h1>
</template>

<script>
function sleep(timeout) {
  return new Promise(resolve => {
    setTimeout(resolve, timeout);
  });
}

export default {
  name: "AsyncComponent",
  props: { timeout: Number },
  async setup(props) {
    await sleep(props.timeout);
  }
};
</script>

<style scoped>
</style>
